<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
    <meta charset="UTF-8">
    <title>login</title>
</head>
<body>
    <h1> 登录页面</h1>
    <a href="#" class="wechatlogin">第三方登录（微信，默认成功后跳转到baidu）</a>

</body>
<script src="/static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
    $(function () {
        console.log(1);
        $('.wechatlogin').click(function () {
            var url = 'http://127.0.0.1:8080/api/wechat/login';
            var state = 'http://www.baidu.com';
            $.ajax({
                url:url,
                data:{"state":state},
                success:function (data) {
                    console.log(data);
                    console.log("======"+data.data);
                    window.location.assign(data.data);
                }
            });
        });
    });

</script>
</html>